//
//  ContactUsViewController.m
//  location
//
//  Created by Dongxiang Xu on 2025/6/25.
//

#import "ContactUsViewController.h"
#import "WXApi.h"

@interface ContactUsViewController ()

@end

@implementation ContactUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = RealWhiteColor;
    [self initView];
}

- (void)initView
{
    UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(16, NAVHEIGHT+6, SCREEN_WIDTH-32, 32)];
    title.font = REAL_MEDIUM_FONT(24);
    title.textAlignment = NSTextAlignmentCenter;
    title.text = @"和我们聊聊";
    title.textColor = RealBlackColor;
    [self.view addSubview:title];
    
    UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-210)/2, title.maxY+36, 210, 210)];
    img.image = [UIImage imageNamed:@"contact"];
    [self.view addSubview:img];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(32, CGRectGetMaxY(img.frame)+36, SCREEN_WIDTH-64, 54)];
    button.layer.masksToBounds = YES;
    [button.layer setCornerRadius:27];
    button.backgroundColor = NormalMainColor;
    [button setTitle:@"联系我们" forState:UIControlStateNormal];
    [button setTitleColor:RealWhiteColor forState:UIControlStateNormal];
    [button.titleLabel setFont:MEDIUM_FONT(17)];
    [self.view addSubview:button];
    [[button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init];
        req.corpid = @"wwd398f4f09a46d09b";    //企业ID
        req.url = @"https://work.weixin.qq.com/kfid/kfcf5c99c0434b5983c";            //客服URL
        [WXApi sendReq:req completion:^(BOOL success) {
            
        }];
    }];
}

@end
